import React, {Component} from 'react';
import {View, Text, Button} from 'react-native';
import NavigationFactory from '../../utils/NavigationFactory';

@NavigationFactory
class Page1 extends Component {
  render() {
    //接受参数
    const {route, navigation} = this.props;
    return (
      <View>
        <Text>{route.params.testRoute}</Text>
        <Button
          title={'跳转到Page2'}
          onPress={() => {
            navigation.navigate('Page2', {name: '测试跳转到page2'});
          }}
        />
      </View>
    );
  }
}

export default Page1;
